//
//  GameLayer.h
//  GameDemo
//
//  Created by cmpak on 5/10/10.
//  Copyright 2010 thefirstgood.com. All rights reserved.
//

#import "cocos2d.h"

typedef enum {
	kFallRight,
	kFallLeft
} EnemyFallDirection;



@interface GameLayer : CCLayer {
    CGSize winSize;
    
    // 방향 전환에 쓰일 버튼
    // 눌리기 전과 눌렸을 때에 쓸 수 있도록 각 방향별로 두개씩 만든다.
    CCSprite  *rightSprite;
    CCSprite  *rightPressedSprite;
    CCSprite  *leftSprite;
    CCSprite  *leftPressedSprite;
	
	// 발차기 버튼
    CCSprite  *kickSprite;
    CCSprite  *kickPressedSprite;
    
    BOOL isLeftPressed;
    BOOL isRightPressed;
    
    // 주인공 캐릭터 - 여자 이미지를 사용하지만 prince라고 부르겠습니다.
    CCSprite *princeSprite;
    
    // 주인공 캐릭터의 걷기 애니메이션
    CCAnimate *princeWalkAnimate;
	
	// 주인공 발차기 애니메이션
    CCAnimate *princeKickAnimate;
	
	// 발차기 애니메이션이 진행 중인지 검사하는데 사용합니다.
    BOOL isAnimating;
	
	//적
	CCSpriteSheet *enemySpriteSheet;
	CCAnimation *enemyWalkAnimation;
}

@property (nonatomic, retain) CCSprite  *rightSprite;
@property (nonatomic, retain) CCSprite  *rightPressedSprite;
@property (nonatomic, retain) CCSprite  *leftSprite;
@property (nonatomic, retain) CCSprite  *leftPressedSprite;
@property (nonatomic, retain) CCSprite  *kickSprite;
@property (nonatomic, retain) CCSprite  *kickPressedSprite;
@property (nonatomic, retain) CCSprite  *princeSprite;
@property (nonatomic, retain) CCAnimate *princeWalkAnimate;
@property (nonatomic, retain) CCAnimate *princeKickAnimate;

@property (nonatomic, retain) CCSpriteSheet *enemySpriteSheet;
@property (nonatomic, retain) CCAnimation *enemyWalkAnimation;

- (void) createBackgroundParallax;
- (void) createArrowButtons;
- (void) createPrinceAndAnimation;
- (void) createEnemyAndAnimation;

- (void) moveBackground;

- (void) startPrinceWalking;
- (void) stopPrinceWalking;

- (void) handleKickHit:(CGPoint)effectPoint enemySprite:(CCSprite*)enemy 
									 directionToFall:(EnemyFallDirection)fallDirection;
													 

@end

